package com.yanqu.road.entity.union.activitygroup;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.union.UnionBaseInfo;

import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_s_union_activity_group_union")
public class UnionActivityGroupUnion extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "分组ID", update = true)
    private int groupId;
    @FieldTypeAnnotation(desc = "商会ID", update = true)
    private String unionUid;
    @FieldTypeAnnotation(desc = "商会信息")
    private UnionBaseInfo unionBaseInfo;
    @FieldTypeAnnotation(desc = "成员数据")
    private ConcurrentHashMap<Long, UnionActivityGroupUser> userMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "锁定名单时的排名")
    private int rank;
    @FieldTypeAnnotation(desc = "锁定名单时的资格（资格锁定）")
    private int locked;
    @FieldTypeAnnotation(desc = "赚速")
    private String ability = "";
    @FieldTypeAnnotation(desc = "成员上限")
    private int memberMax;

    public void copyData(UnionActivityGroupUnion union) {
        this.activityId = union.getActivityId();
        this.groupId = union.getGroupId();
        this.unionUid = union.getUnionUid();
        this.unionBaseInfo = union.getUnionBaseInfo();
        this.userMap = union.getUserMap();
        //以下保留初始数据，不覆盖
        //this.rank = union.getRank();
        //this.locked = union.getLocked();
        setUpdateOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public void setUnionUid(String unionUid) {
        this.unionUid = unionUid;
    }

    public UnionBaseInfo getUnionBaseInfo() {
        return unionBaseInfo;
    }

    public void setUnionBaseInfo(UnionBaseInfo unionBaseInfo) {
        this.unionBaseInfo = unionBaseInfo;
    }

    public ConcurrentHashMap<Long, UnionActivityGroupUser> getUserMap() {
        return userMap;
    }

    public void setUserMap(ConcurrentHashMap<Long, UnionActivityGroupUser> userMap) {
        this.userMap = userMap;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public int getLocked() {
        return locked;
    }

    public void setLocked(int locked) {
        this.locked = locked;
    }

    public String getAbility() {
        return ability;
    }

    public void setAbility(String ability) {
        this.ability = ability;
    }

    public int getMemberMax() {
        return memberMax;
    }

    public void setMemberMax(int memberMax) {
        this.memberMax = memberMax;
    }

}
